﻿module Sustainalytics.Routing {
    
    export class RoutingStateEngineAdapter implements IRoutingEngineAdapter {

        constructor(
            private $state: ng.ui.IStateService,
            private $stateParams: ng.ui.IStateParamsService) {
        }

        public getCurrentPath(): string {
            var ctx = this;

            if (!ctx.$state.current)
                return '/';

            return ctx.$state.current.url;
        }

        public getRouteParams(): any {
            var ctx = this;

            return ctx.$stateParams;
        }
    }
}